
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
keep-alive-agent
Advanced tools
keep-alive-agent is an HTTP connection pool agent for node.js that re-uses sockets. It is simpler than some agents that also solve this problem because it does not attempt to replace the Agent provided by node. If you want to re-use connections, use this agent. If you want the default node behavior, use the default global agent.
new KeepAliveAgent(options-hash)
Create an instance of the agent, passing the options hash through to the node Agent constructor. These options are in turn passed along to createConnection()
. The KeepAliveAgent constructor does not use the options itself. The option you are most likely to change is maxSockets
, which defaults to 5.
To use the agent instance, set it in the agent
field of the options passed to http.request()
or http.get()
. See the http.request() documentation for details.
new KeepAliveAgent.Secure(options-hash)
A keep-alive agent that creates tls sockets. Use it the same way you use the http agent.
var http = require('http'),
KeepAliveAgent = require('keep-alive-agent');
var getOptions = {
hostname: 'twitter.com',
port: 80,
path: '/dshaw',
agent: new KeepAliveAgent(),
};
http.get(getOptions, function(response)
{
response.pipe(process.stdout);
});
To re-use secure connections, use the Secure keep-alive agent:
var https = require('https'),
KeepAliveAgent = require('keep-alive-agent');
var getOptions = {
hostname: 'www.duckduckgo.com',
port: 443,
path: '/?q=unicorns',
agent: new KeepAliveAgent.Secure(),
};
https.get(getOptions, function(response)
{
response.pipe(process.stdout);
});
For other implementations, see agentkeepalive and the request module's ForeverAgent.
MIT.
FAQs
a keep-alive agent for http and https
The npm package keep-alive-agent receives a total of 37,844 weekly downloads. As such, keep-alive-agent popularity was classified as popular.
We found that keep-alive-agent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.